package com.ap.generator.requestorigination;

import com.ap.core.cxf.jaxb.requestorigin.AbstractDeviceInfoTypeGeneratorBuilder;
import com.ap.core.cxf.jaxb.requestorigin.DeviceOSType;
import com.ap.datagen.core.GeneratorHelper;

import static com.ap.datagen.core.GeneratorHelper.randomGeneratorFromEnum;
import static com.ap.datagen.core.Nullable.nullable;
import static com.ap.datagen.lang.StringRandomGeneratorBuilder.stringRandomGeneratorBuilder;

/**
 * 
 * @author Siva.Pochana
 *
 */
public class DeviceInfoTypeGeneratorBuilder extends
		AbstractDeviceInfoTypeGeneratorBuilder {

	@Override
	public void setupDefaults() {
		this.IPAddressGenerator = nullable(stringRandomGeneratorBuilder().numeric().length(45).build());
		this.deviceOSGenerator = nullable(randomGeneratorFromEnum(DeviceOSType.WIN));
	}
	
	public static DeviceInfoTypeGeneratorBuilder deviceInforTypeGenerator() {
		return new DeviceInfoTypeGeneratorBuilder();
	}

	public DeviceInfoTypeGeneratorBuilder withDeviceOS(DeviceOSType type) {
		this.deviceOSGenerator =  nullable(GeneratorHelper.fixedValueGenerator(type));
		return this;
	}
}
